//
//  DraftEditCell.m
//  TravelFollowYourHeart
//
//  Created by ENERGY on 2018/1/17.
//  Copyright © 2018年 Lwx. All rights reserved.
//

#import "DraftEditCell.h"

@interface DraftEditCell()
@end

@implementation DraftEditCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _imageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageView];
        
        _deleteBtn = [[UIButton alloc] init];
        [_deleteBtn setImage:[UIImage imageNamed:@"guanbi"] forState:UIControlStateNormal];
        [_deleteBtn addTarget:self action:@selector(deleteBtnClick) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_deleteBtn];

    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    _imageView.frame = CGRectMake(0, 0, self.contentView.width, self.contentView.height);
    _deleteBtn.frame = CGRectMake(self.contentView.width - 20, 0, 20, 20);
}

- (void)deleteBtnClick{
    if (self.block) {
        self.block();
    }
}

@end
